package com.deyuanyun.pic.settings.controller.vo;

import com.deyuanyun.pic.settings.domain.prvlg.User;
import com.deyuanyun.pic.settings.domain.prvlg.UserGroup;
import com.github.pagehelper.Page;

public class UserVO extends SettingsBaseVO<User> {

    // 角色编号
    private String state;

    public String getState() {
        return state;
    }

    public void setState(String state) {
        this.state = state;
    }

    @Override
    public void fromDomain(User domain) {

        // 角色编号
        this.state = domain.getState();

        super.fromDomain(domain.getId(), domain.getCreateRemark());
    }

    public Page<UserVO> fromDomainList(Page<User> domainList) {
        Page<UserVO> list = new Page<UserVO>();
        for (User user : domainList) {
            UserVO userVO = new UserVO();
            userVO.fromDomain(user);
            list.add(userVO);
        }
        converterPage(domainList, list);
        return list;
    }
}